.carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100vh; /* Mantiene la altura según las necesidades */
}

.carousel-images {
  display: flex;
  transition: transform 1s ease-in-out;
  width: 100%;
  height: 85%; /* Mantiene la altura del carrusel */
}

.carousel-image {
  position: relative;
  min-width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* Overlay oscuro */
.carousel-image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Fondo negro con 50% de opacidad */
  z-index: 1;
}

/* el contenido esté por encima del overlay */
.carousel-image > * {
  position: relative;
  z-index: 2; /* El texto estará por encima del overlay */
}

.carousel-caption {
  position: absolute;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: 20px;
  box-sizing: border-box;
  pointer-events: none;
  display: grid;
  column-gap: 50px;
  grid-template-areas:
    "header 0 0 0 0"
    "1 1 1 1 1"
    "2 2 2 2 footer";
}

/* Títulos y texto del carrusel */
.carousel-title {
  align-self: flex-start;
  font-size: 2em;
  color: white;
  margin: 0;
  grid-area: header;
}

.carousel-text {
  align-self: flex-end;
  font-size: 1.5em;
  color: white;
  margin: 0;
  text-align: left;
  grid-area: footer;
}

/* Media Queries para hacer el diseño responsive */
@media (max-width: 1024px) {
  .carousel-caption {
    padding: 15px;
    column-gap: 30px;
    grid-template-areas:
      "header"
      "1"
      "2"
      "footer";
  }

  .carousel-title {
    font-size: 1.8em;
  }

  .carousel-text {
    font-size: 1.2em;
  }
}

@media (max-width: 768px) {
  .carousel-caption {
    padding: 10px;
    column-gap: 20px;
    grid-template-areas:
      "header"
      "1"
      "2"
      "footer";
  }

  .carousel-title {
    font-size: 1.5em;
  }

  .carousel-text {
    font-size: 1em;
  }
}

@media (max-width: 480px) {
  .carousel-caption {
    padding: 5px;
    column-gap: 10px;
    grid-template-areas:
      "header"
      "1"
      "2"
      "footer";
  }

  .carousel-title {
    font-size: 1.2em;
  }

  .carousel-text {
    font-size: 0.9em;
  }
}
